package com.zzh.phone.hviews;

import android.os.Bundle;
import android.view.View;
import android.widget.SeekBar;

import com.zzh.lib.views.progressbar.HCircleProgressBar;
import com.zzh.lib.views.progressbar.HFloatTextProgressBar;
import com.zzh.lib.views.progressbar.HProgressBar;
import com.zzh.phone.hviews.databinding.ActPbBinding;

import androidx.appcompat.app.AppCompatActivity;

/**
 * 进度条 示例
 */
public class ProgressBarActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActPbBinding bind = ActPbBinding.inflate(getLayoutInflater());
        setContentView(bind.getRoot());
        SeekBar seekBar = findViewById(R.id.seekBar);


        final HProgressBar progressBar = findViewById(R.id.progressBar);

        final HFloatTextProgressBar floatTextProgressBar = findViewById(R.id.floatTextProgressBar);

        final HCircleProgressBar circleProgressBar = findViewById(R.id.circleProgressBar);
        seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
                progressBar.setProgress(progress);
                floatTextProgressBar.setProgress(progress);
                circleProgressBar.setProgress(progress);
            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {

            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {

            }
        });
        bind.fgv.setOnClickListener(v -> {
            bind.fgv.startFollowAnimation(() -> {
                bind.fgv.setVisibility(View.GONE);
            });
        });


    }
}
